<extend name="Layout:layout_list" />
<block name="body_content_block">
    <table id="main_grid" class="easyui-datagrid" data-url="{:AddonU('Statics/get_seatwork_list_json')}"></table>
    <div id="tb" style="padding:2px 5px;">
        <div style="margin-bottom: 5px; border-bottom:solid 1px #dddddd;">
            <a href="#" class="easyui-linkbutton lnk_grid_search" iconCls="icon-search" plain="true">搜索</a>
        </div>
    </div>
    <!--隐藏区域-->
    <div style="display:none">
        <!--表格查询对话框-->
        <div id="dlg_search" style="padding:10px">
            <form method="get" action="{:AddonU('Statics/get_seatwork_list_json')}" data-export-url="{:AddonU('Statics/seatwork_export')}">
                日期：<input type="text" name="date" class="easyui-datebox" value="{$search.date}" />
                时间：<input type="text" class="easyui-timespinner" name="beginTime" data-options="showSeconds:true" value="{$search.beginTime}" />至<input type="text" class="easyui-timespinner" data-options="showSeconds:true" name="endTime" value="{$search.endTime}" />
                <if condition="$isSuperAdmin">
                    租户：<input type="text" id="siteID" name="siteID" data-url="{:AddonU('Admin/get_admin_json')}" />
                    <else/>
                    <input type="hidden" name="siteID" value="{$loginData.siteID}"/>
                </if>
            </form>   
        </div>
        <!--/表格查询对话框-->
    </div>
    <!--/隐藏区域-->
</block>
<block name="body_after_block">
    <script type="text/javascript">
        // 页面初始化
        var curd_grid = CurdGrid.newInstance();
        curd_grid.before_search_dialog = function () {
            $('#siteID').combobox({url: $('#siteID').data('url'), valueField: 'id', textField: 'text'});
        }
        curd_grid.config({
            title: '坐席工作统计',
            toolbar: '#tb',
            fitColumns: true,
            showFooter: true,
            columns: [[
                    {title: "租户ID", field: "siteIDText", sortable: true},
                    {title: "日期", field: "billdate", sortable: true},
                    {title: "工号", field: "agentID", sortable: true},
                    {title: "姓名", field: "personalName", sortable: true},
                    {title: "开始时间", field: "beginTime", sortable: true},
                    {title: "结束时间", field: "endTime", sortable: true},
                    {title: "签入次数", field: "workCount", sortable: true},
                    {title: "签入时长", field: "workDurationText", sortable: true},
                    {title: "签出次数", field: "leaveCount", sortable: true},
                    {title: "签出时长", field: "leaveDurationText", sortable: true},
                    {title: "编号", field: "id", hidden: true},
                ]],
        });
        curd_grid.init();
    </script>
</block>